<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<html lang="en" class="no-js">
<!--<![endif]-->

<head>
<meta charset="utf-8">
<title>买盘池</title>
<link href="${request.getContextPath()}/Public/assets/admin/css/css.css"
	rel="stylesheet" type="text/css">
<link
	href="${request.getContextPath()}/Public/assets/global/plugins/font-awesome/css/font-awesome.min.css"
	rel="stylesheet" type="text/css">
<link
	href="${request.getContextPath()}/Public/assets/global/plugins/simple-line-icons/simple-line-icons.min.css"
	rel="stylesheet" type="text/css">
<link
	href="${request.getContextPath()}/Public/assets/global/plugins/bootstrap/css/bootstrap.min.css"
	rel="stylesheet" type="text/css">
<link
	href="${request.getContextPath()}/Public/assets/global/plugins/uniform/css/uniform.default.css"
	rel="stylesheet" type="text/css">
<link rel="${request.getContextPath()}/Public/stylesheet"
	type="text/css"
	href="assets/global/plugins/jquery-notific8/jquery.notific8.min.css" />
<link
	href="${request.getContextPath()}/Public/assets/global/css/components-rounded.css"
	id="style_components" rel="stylesheet" type="text/css">
<link
	href="${request.getContextPath()}/Public/assets/global/css/plugins.css"
	rel="stylesheet" type="text/css">
<link
	href="${request.getContextPath()}/Public/assets/admin/css/layout.css"
	rel="stylesheet" type="text/css">
<link
	href="${request.getContextPath()}/Public/assets/admin/css/themes/default.css"
	rel="stylesheet" type="text/css" id="style_color">
<link
	href="${request.getContextPath()}/Public/assets/admin/css/custom.css"
	rel="stylesheet" type="text/css">
<link
	href="${request.getContextPath()}/Public/assets/global/plugins/bootstrap-datepicker/css/bootstrap-datepicker.min.css"
	rel="stylesheet" type="text/css">
<link
	href="${request.getContextPath()}/Public/assets/global/css/kkpager.css"
	rel="stylesheet" type="text/css">
<link
	href="${request.getContextPath()}/Public/assets/admin/css/common.css"
	rel="stylesheet" type="text/css">
<link rel="shortcut icon"
	href="${request.getContextPath()}/Public/assets/global/plugins/datatables/media/images/favicon.ico">
<link href="${request.getContextPath()}/Public/css/customerDetail.css" rel="stylesheet" type="text/css">
<script>
	BASE_URL = '${request.getContextPath()}'
</script>
<style type="text/css">
a:hover {
	text-decoration: none;
	color: red
}

a:visited {
	text-decoration: none;
}

a:link {
	text-decoration: none;
}

a:active {
	text-decoration: none;
}

#remind1 {
	font-family: 'Arial Normal', 'Arial';
	background-color: rgb(247, 51, 51);
	border: 1px solid rgb(247, 18, 18);
	font-weight: 400;
	font-size: 13px;
	color: #F5F1F5;
}

#remind2 {
	font-family: 'Arial Normal', 'Arial';
	font-weight: 400;
	font-size: 13px;
	color: rgb(247, 18, 18);
	border: 1px solid rgb(247, 18, 18);
}
</style>
<body class="page-header-top-fixed">
	<!-- END HEADER -->
	<div class="page-header">
		<!--头部开始-->
		<#include "/include/top.html" />
		<!-- 头部信息结束 -->
		<!-- 头部菜单开始 -->
		<#include "/include/top_menu.html" />
		<!-- 头部菜单结束 -->
	</div>

	<!-- BEGIN PAGE CONTAINER -->
	<div class="page-container">
		<div class="page-content">
			<div class="container-fluid">
				<ul class="page-breadcrumb breadcrumb">
				<li>
					<a href="#">首页</a><i class="fa fa-circle"></i>
				</li>
				<li class="active">
					撮合管理<i class="fa fa-circle"></i>
				</li>
				<li class="active">
					买盘池
				</li>
			</ul>
				<div class="row margin-top-10">
					<div class="col-md-12">
						<div id="u351" class="text">
							<div class="row margin-top-10">
							<#if Session['userInfo']['itemId'] != '26278' && Session['userInfo']['itemId'] != '26297' && Session['userInfo']['itemId'] != '26299'>
								<div class="col-md-12">
									<div class="portlet light bordered">
										<div class="portlet-body"
											style="height: 13px;padding-top: 0px">
											<div style="float:left;width: 77%">
												<span>有色网报价：&nbsp;</span> <span
													style="font-family:'Arial Negreta', 'Arial';font-weight:700;font-size:13px;color:#333333;"
													id="itemName"></span> <span
													style="font-family:'Arial Normal', 'Arial';font-weight:400;font-size:13px;color:#333333;">
													￥</span> <span
													style="font-family:'Arial Normal', 'Arial';font-weight:400;font-size:14px;color:#D7000F;"
													id="price">00.00 </span> 
													<#if items.name?contains("银")>
														<span style="font-family:'Arial Normal', 'Arial';font-weight:400;font-size:13px;color:#333333;">元/千克&nbsp;</span>
													<#else>
														<span style="font-family:'Arial Normal', 'Arial';font-weight:400;font-size:13px;color:#333333;">元/吨&nbsp;</span>
													</#if>
												<!-- 									<span style="font-family:'Arial Negreta', 'Arial';font-weight:700;font-size:13px;color:#333333;">1#锡</span> -->
												<!-- 									<span style="font-family:'Arial Normal', 'Arial';font-weight:400;font-size:13px;color:#333333;"> ￥</span> -->
												<!-- 									<span style="font-family:'Arial Normal', 'Arial';font-weight:400;font-size:14px;color:#D7000F;">12400.00 元/吨</span> -->
												<span
													style="font-family:'Arial Normal', 'Arial';font-weight:400;font-size:13px;color:#333333;">&nbsp;
													SHFE: </span> <span
													style="font-family:'Arial Normal', 'Arial';font-weight:400;font-size:14px;color:#D7000F;"
													id="avg">00.00</span> <span
													style="font-family:'Arial Normal', 'Arial';font-weight:400;font-size:14px;color:#333333;">&nbsp;
													涨速: </span> <span
													style="font-family:'Arial Normal', 'Arial';font-weight:400;font-size:14px;color:#D7000F;"
													id="float"> </span> <span style="display: none"
													id="remind1">&nbsp; 异动提醒&nbsp; </span> <span
													style="display: none" id="remind2"></span> <span
													style="font-family:'Arial Normal', 'Arial';font-weight:400;font-size:13px;color:#333333;">&nbsp;
													<a
													href="http://finance.sina.com.cn/futures/quotes/${productType}0.shtml"
													target='_blank'><i class="fa fa-bar-chart-o" onclick=""></i></a>
												</span>
											</div>
											<div
												style="float: right;width: 23%;text-align: right;padding-right: 18px;">
												<p>
													更新时间：<span id="updateTime"> </span>
												</p>
											</div>
										</div>
									</div>
								</div>
								</#if>
							</div>
					<div class="row margin-top-10">
							<div class="col-md-12">
						<div class="portlet light bordered">
							<div class="portlet-body" style="height: 13px;padding-top: 0px">
								<div style="float: left;">
									视图： <a
										href="${request.getContextPath()}/buypool/buylist.do">全部</a>|
									<a
										href="${request.getContextPath()}/buypool/buylist.do?falg=1">我的客户</a>|
									<a
										href="${request.getContextPath()}/buypool/buylist.do?falg=2">部门客户</a>
								</div>
							</div>
						</div>
					</div>
					</div>
						</div>
						<div class="portlet light bordered">
							<div class="portlet-body">
								<form action="" id="batchform">
									<div class="row">
										<div style="float: left;width: 10%; margin-left: 15px;">
										<div class="btn-group pull-left">
											<button class="btn green dropdown-toggle" onclick="CommonUtils.doExecute('${request.getContextPath()}/buypool/delbuypool.do');"
												data-toggle="dropdown" aria-expanded="true">
												批量删除
												<!-- <i class="fa fa-angle-down"></i>-->
											</button>											
										</div>
									</div>

										<div
											style="float: right;width: 28%;text-align: right;padding-right: 18px;">
											<a class="btn green"
												href="${request.getContextPath()}/buypool/toaddbuypool.do">
												<i class="fa fa-plus"></i> 新建买盘
											</a>
											<p class="btn green" onclick="trailExport()">
												<i class="fa fa-file-excel-o"></i> 导出
											</p>
										</div>
									</div>
									
								</form>
								<div class="table-scrollable">

								<#if falg??>
									<input type="hidden" id="falg" value="${falg}" />
								</#if>

									<table class="table table-striped table-bordered table-hover ttTbl"
										id="myTable">
										<thead>
											<tr>
												<th class="table-checkbox"><input type="checkbox"
													class="group-checkable" data-set="#myTable .checkboxes" />
												</th>
												<th>公司名</th>
												<th>采购标题</th>
												<th>采购内容</th>
												<th>联系人</th>
												<th>电话</th>
												<th>地区</th>
												
												<th>操作</th>
											</tr>
										</thead>
										<tbody>
											<#list buypoollist as buy>
											<tr>
												<td><input type="checkbox" class="checkboxes"
													name="checkboxes" value="${buy.id}" /></td>
												<td>${(buy.companyname)!}</td>
												<td>${(buy.title)!}</td>
												<td>${(buy.context)!}</td>
												<td>${(buy.contacterName)!}</td>
												<td>${(buy.mobilePhone)!}</td>
												<td>${(buy.areaName)!}</td>
												<td><a class="btn btn-xs green"
													href="${request.getContextPath()}/buypool/toaddbuyorder.do?ids=${buy.id}&poolType=2"> 生成订单</a>
													 <#if buy.proStatus?? && buy.proStatus=="0" >
													<a class="btn btn-xs green" 
													href="${request.getContextPath()}/buypool/probuypool.do?id=${buy.id}"> 处 理</a>
													<#else>
													<a class="btn btn-xs gray" 
													href="#">已处理</a>
												 	</#if>
													<a class="btn btn-xs green"
													href="${request.getContextPath()}/buypool/delbuypoolone.do?ids=${buy.id}">隐藏</a></td>
											</tr>
											</#list>
										</tbody>
									</table>
								</div>
								<div style="width:80%;margin:0 auto;">
									<div id="kkpager"></div>
									<input type="hidden" value="${totalPage}" id="totalPage">
									<input type="hidden" value="${totalRecords}" id="totalRecords">
							</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>

	<!-- 内容结束 -->
	<!-- 底部开始 -->
	<#include "/include/foot.html" />
	<!-- 底部结束 -->

	<!--[if lt IE 9]>
<script src="${request.getContextPath()}/Public/assets/global/plugins/respond.min.js"></script>
<script src="${request.getContextPath()}/Public/assets/global/plugins/excanvas.min.js"></script> 
<![endif]-->
	<script
		src="${request.getContextPath()}/Public/assets/global/plugins/jquery.min.js"
		type="text/javascript"></script>
	<script
		src="${request.getContextPath()}/Public/assets/global/plugins/jquery-migrate.min.js"
		type="text/javascript"></script>
	<script
		src="${request.getContextPath()}/Public/assets/global/plugins/jquery-ui/jquery-ui.min.js"
		type="text/javascript"></script>
	<script
		src="${request.getContextPath()}/Public/assets/global/plugins/bootstrap/js/bootstrap.min.js"
		type="text/javascript"></script>
	<script
		src="${request.getContextPath()}/Public/assets/global/plugins/bootstrap-hover-dropdown/bootstrap-hover-dropdown.min.js"
		type="text/javascript"></script>
	<script
		src="${request.getContextPath()}/Public/assets/global/plugins/jquery-slimscroll/jquery.slimscroll.min.js"
		type="text/javascript"></script>
	<script
		src="${request.getContextPath()}/Public/assets/global/plugins/jquery.blockui.min.js"
		type="text/javascript"></script>
	<script
		src="${request.getContextPath()}/Public/assets/global/plugins/jquery.cokie.min.js"
		type="text/javascript"></script>
	<script
		src="${request.getContextPath()}/Public/assets/global/plugins/uniform/jquery.uniform.min.js"
		type="text/javascript"></script>
	<script
		src="${request.getContextPath()}/Public/assets/global/plugins/jquery-notific8/jquery.notific8.min.js"></script>

	<script
		src="${request.getContextPath()}/Public/assets/global/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js"
		type="text/javascript"></script>

	<script
		src="${request.getContextPath()}/Public/assets/global/scripts/metronic.js"
		type="text/javascript"></script>
	<script
		src="${request.getContextPath()}/Public/assets/admin/scripts/layout.js"
		type="text/javascript"></script>
	<script
		src="${request.getContextPath()}/Public/assets/global/plugins/kkpager.min.js"
		type="text/javascript"></script>
	<script
		src="${request.getContextPath()}/Public/assets/admin/scripts/commonUtils.js"
		type="text/javascript"></script>
	<script
		src="${request.getContextPath()}/Public/assets/admin/scripts/priceFloat.js"
		type="text/javascript"></script>
	<script
		src="${request.getContextPath()}/Public/assets/admin/scripts/tc.min.js"
		type="text/javascript"></script>
	<script
		src="${request.getContextPath()}/Public/assets/admin/scripts/ajaxfileupload.js"
		type="text/javascript"></script>
	
<script>

	jQuery(document).ready(function() {
		   Metronic.init(); // init metronic core componets
		   Layout.init(); // init layout
		   CommonUtils.checkInit();
		   PriceFloat.getPriceProduct();
		});
		function trailExport(){
			var arr = $("#myTable tbody input:checked");
			

			var ids = "";
			for(var i =0;i < arr.length; i++){
				if(i > 0){
					ids +=",";
				}
				ids += arr[i].value;
			}
			
			var flag=$("#flag").val();
			
			window.location.href= BASE_URL + "/buypool/buyPoolExport.do?ids=" + ids+"&falg="+flag;
			
		}
		
		//初始化分页插件
		function getParameter(name) { 
			var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)"); 
			var r = window.location.search.substr(1).match(reg); 
			if (r!=null) return unescape(r[2]); return null;
		}
		
		//init
		$(function(){
			
			//价格走势循坏15秒刷新
			window.setInterval(PriceFloat.getPriceProduct, 15 * 1000);
			var falg=$("#falg").val();
			var totalPage = $('#totalPage').val();
			var totalRecords = $('#totalRecords').val();
			
			var pageNo = getParameter('pno');
			if(!pageNo){
				pageNo = 1;
			}



			//生成分页
			//有些参数是可选的，比如lang，若不传有默认值
			kkpager.generPageHtml({
				pno : pageNo,
				//总页码
				total : totalPage,
				//总数据条数
				totalRecords : totalRecords,

				getLink : function(n){
					return this.hrefFormer + this.hrefLatter + "?pno="+n+"&falg="+falg;

				}
			});

		});
		

//		function trailExport (){
//			var checks=CommonUtils.getCheckedBoxs().join(",");
//			if(checks.length==0)
//			{
//				alert("请勾选需要导出项！");
//				return;
//			}
//			window.location="${request.getContextPath()}/buypool/buyPoolExport.do?ids="+checks;
//	}
		
</script>
	
</body>
</html>